package BankingApplication;

import java.awt.GridLayout;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class AddCustomerFrame extends JPanel
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	JFrame customerFrame;

	// create labels for customer attributes
	JLabel fNameLabel = new JLabel("First Name");
	JLabel lNameLabel = new JLabel("Last Name");
	JLabel addressLabel = new JLabel("Address (House number Street City State, Zipcode Country)");
	JLabel phoneNumLabel = new JLabel ("Phone Number");
	JLabel ssnLabel = new JLabel("SSN");
	// create text fields for customers to enter attributes
	JTextField fNameText = new JTextField();
	JTextField lNameText = new JTextField();
	JTextField addressText = new JTextField();
	JTextField phoneNumText = new JTextField();
	JTextField ssnText = new JTextField();

	public AddCustomerFrame ()
	{	
		customerFrame = makeCustomerFrame();
		setFocusable(false);
		customerFrame.pack();
	}
	
	private JFrame makeCustomerFrame()
	{
		JFrame customerFrame = new JFrame();

		// add labels and boxes to container
		setLayout( new BoxLayout(this, BoxLayout.Y_AXIS));
		add(fNameLabel);
		add(fNameText);
		add(lNameLabel);
		add(lNameText);
		add(addressLabel);
		add(addressText);
		add(phoneNumLabel);
		add(phoneNumText);
		add(ssnLabel);
		add(ssnText);
		add(buttonLayout());
		customerFrame.add(this);
		return customerFrame;
	}
	
	
	private JPanel buttonLayout()
	{
		JPanel buttons = new JPanel();
		buttons.setLayout(new GridLayout(1, 2));
		JButton submitButton = new JButton("SUBMIT");
		JButton cancelButton = new JButton("CANCEL");
		buttons.add(submitButton);
		buttons.add(cancelButton);
		return buttons;
	}


}
